package com.example.networktest

import kotlinx.coroutines.*

fun main() {

    runBlocking {
        /*println("codes run in coroutine scope")
        delay(1500)
        println("codes run in coroutine scope finished")*/
        /*repeat(100000) {
            launch {
                println(".")
            }
        }*/

        runBlocking {
            val start = System.currentTimeMillis()
            val deferred1 = async {
                delay(1000)
                5 + 5
            }
            val deferred2 = async {
                delay(1000)
                8 - 3
            }
            println("result is ${deferred1.await() + deferred2.await()}")
            val end = System.currentTimeMillis()
            println(end - start)
        }
    }

}